package com.xunsiya.service.module.order.impl;

import com.xunsiya.module.order.dao.ProductMapper;
import com.xunsiya.module.order.dao.ProductPriceMapper;
import com.xunsiya.module.order.vo.Product;
import com.xunsiya.service.module.order.ProductService;
import com.xunsiya.tools.common.msg.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 产品服务
 *
 * @author panjun
 * @version 1.0
 *          <p>
 *          <p>修订人		修订时间			描述信息
 *          <p>-----------------------------------------------------
 *          <p>panjun		2018/10/31		初始创建
 */
@Service("productService")
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Autowired
    private ProductPriceMapper productPriceMapper;

    /**
     * 查询产品服务
     * @return
     */
    @Override
    public List<Product> findByParentId() {
        return productMapper.findByParentId();
    }

    @Override
    public Product findOne(Long id) {
        return productMapper.findOne(id);
    }

    /**
     * 查询产品价格信息 (月份)
     * @return
     */
    @Override
    public Msg findProductPrice() {
        return new Msg(true,"",productPriceMapper.findProductPrice());
    }
}
